home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #2 / Amiga Plus CD - 2004 - No. 02.iso / AmigaPlus / Tools / Development / AmigaTalk / testfiles / TestMsgPort < prev    next >
Encoding:
Text File  |  2004-01-31  |  1.3 KB  |  48 lines

  1. myPort <- MsgPort new: 'AmigaTalkTestPort'
  2.  
  3. ( 'Executing the TestMsgPort file...' ) print
  4. ( 'This test file uses the AmigaTalk:C/MsgPortTester program ' ) print
  5.  
  6. talkToPort    <- 'ForeignMsgPort'
  7. talkToMsgSize <- 80
  8.  
  9. "Start our auxillary MsgPort Testing program: "
  10.  
  11. amigatalk sh: 'Run AmigaTalk:C/MsgPortTester ', talkToPort
  12.  
  13. myPort addPort: talkToMsgSize priority: 0
  14.  
  15. amigatalk setIOTitle:    'Testing Class MsgPort:'
  16. amigatalk setIOMessage:  'Ready to do some tests?'
  17. amigatalk displayString: '(Press DONE when ready)'
  18.  
  19. portPresent <- myPort checkForPort
  20.  
  21. ( 'portPresent sez: ', (portPresent asString)) print
  22.  
  23. talkTo <- myPort getNamedSystemPort: talkToPort
  24.  
  25. myMsg  <- 'En guarde MsgPort Tester!'
  26.  
  27. ('I told the MsgPortTester:  ', myMsg ) print 
  28.  
  29. myPort sendMessageOutsideTo: talkTo msg: (myMsg asByteArray)
  30.  
  31. replyWas <- myPort getMessage
  32.  
  33. ('MsgPortTester replied:  ') print
  34.  
  35. replyWas printAsChars " V2.3 ByteArray method "
  36.  
  37. amigatalk setIOMessage:  'Now, I am going to tell the Tester to go away!'
  38. amigatalk displayString: '(Press DONE when ready)'
  39.  
  40. myPort sendMessageOutsideTo: talkTo msg: ('QUIT' asByteArray)
  41.  
  42. amigatalk setIOMessage:  'The Tester window should now be gone!'
  43. amigatalk displayString: '(Press DONE when ready)'
  44.  
  45. myPort killPort 
  46.  
  47. ( 'Finished with TestMsgPort!!' ) print
  48.